package proj.novel;

import java.beans.*;
import java.io.*;
import java.util.*;

public class AddNovel {
	public static void main(String[] args) {
		XMLEncoder xe = null;
		List<Novel> list = new ArrayList<Novel>();
		Novel novel = new Novel();
		String name = "西游记";
		String author = "吴承恩";
		String intro = "《西游记》是中国古典神魔小说中的巅峰之作，书中讲述了唐僧师徒四人一路降妖伏魔，历经整整九九八十一难取经的故事。";
		novel.setName(name);
		novel.setAuthor(author);
		novel.setIntro(intro);
		novel.setNo(1);
		list.add(novel);
		try {
			xe = new XMLEncoder(new FileOutputStream("src/proj/novel/novelIntro.xml"));
			xe.writeObject(list);
			xe.flush();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (xe != null)
				xe.close();
		}
	}
}
